package yyl.example.demo.asm;

import java.io.IOException;

import org.objectweb.asm.ClassReader;

//通过ASM读取类的字节码
public class ClassReaderExample {

	public static void main(String[] args) throws IOException {
		ClassReader reader = new ClassReader(code);
		System.out.println(reader.getClassName());
	}

	/* private static class Test {} */
	private static byte[] code = { -54, -2, -70, -66, 0, 0, 0, 51, 0, 20, 7, 0, 2, 1, 0, 46, 121, 121, 108, 47, 101, 120, 97, 109, 112, 108, 101, 47,
			100, 101, 109, 111, 47, 97, 115, 109, 47, 98, 97, 115, 101, 47, 67, 108, 97, 115, 115, 82, 101, 97, 100, 101, 114, 84, 101, 115, 116, 36,
			84, 101, 115, 116, 7, 0, 4, 1, 0, 16, 106, 97, 118, 97, 47, 108, 97, 110, 103, 47, 79, 98, 106, 101, 99, 116, 1, 0, 6, 60, 105, 110, 105,
			116, 62, 1, 0, 3, 40, 41, 86, 1, 0, 4, 67, 111, 100, 101, 10, 0, 3, 0, 9, 12, 0, 5, 0, 6, 1, 0, 15, 76, 105, 110, 101, 78, 117, 109, 98,
			101, 114, 84, 97, 98, 108, 101, 1, 0, 18, 76, 111, 99, 97, 108, 86, 97, 114, 105, 97, 98, 108, 101, 84, 97, 98, 108, 101, 1, 0, 4, 116,
			104, 105, 115, 1, 0, 48, 76, 121, 121, 108, 47, 101, 120, 97, 109, 112, 108, 101, 47, 100, 101, 109, 111, 47, 97, 115, 109, 47, 98, 97,
			115, 101, 47, 67, 108, 97, 115, 115, 82, 101, 97, 100, 101, 114, 84, 101, 115, 116, 36, 84, 101, 115, 116, 59, 1, 0, 10, 83, 111, 117,
			114, 99, 101, 70, 105, 108, 101, 1, 0, 20, 67, 108, 97, 115, 115, 82, 101, 97, 100, 101, 114, 84, 101, 115, 116, 46, 106, 97, 118, 97, 1,
			0, 12, 73, 110, 110, 101, 114, 67, 108, 97, 115, 115, 101, 115, 7, 0, 18, 1, 0, 41, 121, 121, 108, 47, 101, 120, 97, 109, 112, 108, 101,
			47, 100, 101, 109, 111, 47, 97, 115, 109, 47, 98, 97, 115, 101, 47, 67, 108, 97, 115, 115, 82, 101, 97, 100, 101, 114, 84, 101, 115, 116,
			1, 0, 4, 84, 101, 115, 116, 0, 32, 0, 1, 0, 3, 0, 0, 0, 0, 0, 1, 0, 2, 0, 5, 0, 6, 0, 1, 0, 7, 0, 0, 0, 47, 0, 1, 0, 1, 0, 0, 0, 5, 42,
			-73, 0, 8, -79, 0, 0, 0, 2, 0, 10, 0, 0, 0, 6, 0, 1, 0, 0, 0, 20, 0, 11, 0, 0, 0, 12, 0, 1, 0, 0, 0, 5, 0, 12, 0, 13, 0, 0, 0, 2, 0, 14,
			0, 0, 0, 2, 0, 15, 0, 16, 0, 0, 0, 10, 0, 1, 0, 1, 0, 17, 0, 19, 0, 10 };
}
